package com.example.message.enums;

/**
 * 通知类型枚举
 */
public enum MessageType {
    
    SYSTEM(1, "系统通知"),
    BUSINESS(2, "业务通知"),
    ANNOUNCEMENT(3, "公告"),
    REMINDER(4, "提醒");
    
    private final Integer code;
    private final String desc;
    
    MessageType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    
    public Integer getCode() {
        return code;
    }
    
    public String getDesc() {
        return desc;
    }
    
    public static MessageType getByCode(Integer code) {
        for (MessageType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}